import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva';
import { Button } from 'antd';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import Burglarproof from "./Components/Burglarproof";


@connect(({ global }) => ({
  dictionaries:global.dictionaries,
  selectSource:global.selectSource,
}))

export default class BurglarproofList extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      isReloadList:false,
    };
  }

  componentWillUnmount(){
    const { dispatch } = this.props;
    dispatch({
      type: `warn/appendClearState`,
    })
  }

  componentDidMount() {
    const { dispatch } = this.props;
    // 数据字典
    // dispatch({
    //   type: 'global/fetch_dictionar',
    //   // payload:["devType", "status", "whitelistReason"]
    // });

  }


  sotpReloadList = () =>{
    this.setState({
      isReloadList:false,
    });
  }


  render() {
    const { dictionaries, selectSource, location} = this.props;
    const { isReloadList } = this.state;

    return (
      <PageHeaderLayout >
        <Burglarproof
          dictionaries={dictionaries}
          selectSource={selectSource}
          sotpReloadList={this.sotpReloadList}
          isReloadList={isReloadList}
          location={location}
        />
      </PageHeaderLayout>

    );
  }
}
